package com.think.teaching.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.think.common.model.Result;
import com.think.common.utils.Common;
import com.think.teaching.service.impl.VrLessonServiceImpl;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("v1")
@Api(tags = "实验接口")
public class VRExpController {

	@Autowired
	private VrLessonServiceImpl vrLessonServiceImpl;
	@GetMapping("open/exp/detailes/{id}")
	public Result GetVrLessonDetailes(@PathVariable("id") Integer id) {
		return Result.success(vrLessonServiceImpl.GetVrLesson(id));
	}
	@ApiOperation("管理员获取实验列表")
	@RequestMapping(value = "admin/exps/{page}/{count}",method = RequestMethod.GET)
	public Result adminListVRExp(@PathVariable("page")Integer page,@PathVariable("count")Integer count,
			@RequestParam(value = "type",required = false,defaultValue = "0") Integer type,
			@RequestParam(value = "mode",required = false,defaultValue = "0") Integer mode,
			@RequestParam(value = "tag",required = false,defaultValue = "0") Integer tag,
			@RequestParam(value = "state",required = false,defaultValue = "-1") Integer state) {
		return Result.success(vrLessonServiceImpl.ListVrLessonWithTagAndType(count, page,type,0,false));

	}
}
